package com.rayboo.example.design.pattern.facade;

public class MobilePhone {

    private IPhone mDefaultPhone;
    private ICamera mDefaultCamera;
    private ICamera mMeituCamera;

    public MobilePhone() {
        mDefaultPhone = new DefaultPhoneImpl();
        mDefaultCamera = new DefaultCameraImpl();
        mMeituCamera = new MeituCameraImpl();
    }

    public void callSomeone(String phoneNumber) {
        mDefaultPhone.call(phoneNumber);
    }

    public void hangup() {
        mDefaultPhone.hangup();
    }

    public void takePicture() {
        mDefaultCamera.open();
        System.out.println("拍照");
        mDefaultCamera.close();
    }

    public void startVideoChat() {
        mDefaultCamera.open();
        System.out.println("开始视频聊天");
        mDefaultCamera.close();
    }

    public void takePictureByMeitu() {
        mMeituCamera.open();
        System.out.println("使用美图相机拍照");
        mMeituCamera.close();
    }
}
